package org.microblog.dao;

import org.microblog.entity.Blog;
import org.microblog.entity.Likes;

import java.sql.SQLException;
import java.util.List;

public interface LikesDao {
    //根据微博id获取微博的点赞数目
    public int getLikeCountByBid(int bid) throws SQLException;
    //删除某条微博的所有点赞
    public int deleteLikesByBid(int bid) throws SQLException;
    //分页获取我的赞列表
    public List<Blog> getLikeBlogsByPage(int uid, String keyword, int pageNo, int pageSize) throws SQLException;
    //获取我的赞总数
    public int getLikesCountByUidAndKeyword(int uid, String keyword) throws SQLException;
    //点赞一条微博
    public int addLikes(Likes likes) throws SQLException;
    //查询是否已点赞该微博
    public Likes findLikes(int uid, int bid) throws SQLException;
    //取消点赞
    public int deleteLikes(Likes likes) throws SQLException;
}
